Public Class TabStrip
    Inherits FarsiLibrary.Win.FATabStrip

    Public Event Notification()
    Public Event StatusChanged(ByVal ln As Integer, ByVal col As Integer, ByVal ins As Boolean)
    Public Event TabSelection()

    Public Overloads Sub AddTab(ByVal tabItem As TabStripItem)
        Me.AddTab(CType(tabItem, FarsiLibrary.Win.FATabStripItem), True)
        Me.Refresh()
        tabItem.OnItemAdded()
        RaiseEvent TabSelection()
    End Sub

    Public ReadOnly Property Item() As TabStripItem
        Get
            If Me.SelectedItem Is Nothing Then
                Return Nothing
            Else
                Return CType(Me.SelectedItem, TabStripItem)
            End If
        End Get
    End Property

    Public Sub RaiseNotificacion()
        RaiseEvent Notification()
    End Sub

    Public Sub RaiseStatusChanged(ByVal ln As Integer, ByVal col As Integer, ByVal ins As Boolean)
        RaiseEvent StatusChanged(ln, col, ins)
    End Sub


    Private Sub TabStrip_TabStripItemSelectionChanged(ByVal e As FarsiLibrary.Win.TabStripItemChangedEventArgs) Handles Me.TabStripItemSelectionChanged
        If e.ChangeType = FarsiLibrary.Win.FATabStripItemChangeTypes.SelectionChanged AndAlso Me.Item IsNot Nothing Then
            Me.Item.OnTabSelection()
            RaiseEvent TabSelection()
        End If
    End Sub

End Class
